package a.f.d;

import a.c.bb;
import a.c.e;
import a.c.k;
import a.c.y;
import a.c.z;

public class j
  extends f
{
  double[] p;
  a_[] q;
  int[] r;
  int[] s;
  double[] t;
  int u;
  int v;
  double w;
  int x = 5;
  int y = 10;
  e[][] z;
  z A;
  static final boolean B = false;
  public static boolean C;
  
  protected void a(bb[] paramArrayOfbb, k paramk)
  {
    int m = f.o;
    int k = f.n;
    n.a(this, "Polyline Drawer");
    this.z = new e[paramArrayOfbb.length][];
    this.r = new int[this.l.k()];
    this.p = new double[this.l.k()];
    this.q = new a_[this.l.k()];
    this.t = new double[this.l.k()];
    this.s = new int[this.l.k()];
    int i = 0;
    label210:
    label212:
    do
    {
      if (i >= paramArrayOfbb.length) {
        break;
      }
      bb localbb = paramArrayOfbb[i];
      e[] arrayOfe = this.z[i] =  = new e[localbb.size()];
      int j = 0;
      if (k != 0) {
        return;
      }
      y localy = localbb.h();
      do
      {
        if (!localy.e()) {
          break;
        }
        e locale = (e)localy.j();
        this.r[locale.f()] = j;
        arrayOfe[j] = locale;
        localy.f();
        j++;
        if (m != 0) {
          break label212;
        }
        if (k != 0) {
          break label210;
        }
      } while (k == 0);
      if (m == 0) {
        i++;
      }
    } while (k == 0);
    f();
    g();
    if (m == 0) {
      k();
    }
  }
  
  void f()
  {
    int n = f.o;
    int m = f.n;
    double d1 = 0.0D;
    double[] arrayOfDouble1 = new double[this.z.length];
    double[] arrayOfDouble2 = new double[this.z.length];
    int i = 0;
    double d4;
    e[] arrayOfe;
    int k;
    do
    {
      if (i >= this.z.length) {
        break;
      }
      double d3 = 0.0D;
      if (m != 0) {
        break label183;
      }
      d4 = 0.0D;
      arrayOfe = this.z[i];
      k = 0;
      if (k < arrayOfe.length)
      {
        d3 += this.l.u(arrayOfe[k]).b();
        d4 = Math.max(d4, this.l.u(arrayOfe[k]).c());
        k++;
      }
      for (;;)
      {
        if (n == 0) {
          if (m == 0)
          {
            if (m == 0) {
              break;
            }
            d3 += (arrayOfe.length - 1) * this.f;
            d1 = Math.max(d1, d3);
            arrayOfDouble2[i] = d4;
            arrayOfDouble1[i] = d3;
            if (n != 0) {
              continue;
            }
            i++;
          }
        }
      }
    } while (m == 0);
    label183:
    double d2 = 0.0D;
    int j = 0;
    label347:
    label349:
    do
    {
      if (j >= this.z.length) {
        break;
      }
      d4 = (d1 - arrayOfDouble1[j]) / 2.0D;
      arrayOfe = this.z[j];
      k = 0;
      do
      {
        if (k >= arrayOfe.length) {
          break;
        }
        e locale = arrayOfe[k];
        double d5 = d2 + (arrayOfDouble2[j] - this.l.u(locale).c()) / 2.0D;
        this.l.b(locale, new a.d.w(d4, d5));
        d4 += this.l.u(locale).b() + this.f;
        k++;
        if (n != 0) {
          break label349;
        }
        if (m != 0) {
          break label347;
        }
      } while (m == 0);
      d2 += arrayOfDouble2[j] + this.g;
      if (n == 0) {
        j++;
      }
    } while (m == 0);
  }
  
  void g()
  {
    int k = f.o;
    int j = f.n;
    double d1 = 1.7976931348623157E+308D;
    double d2 = h();
    if (k == 0) {
      if (d2 >= d1) {
        d1 = d2 + 1.0D;
      }
    }
    int i = 0;
    do
    {
      while (j == 0)
      {
        if (i >= this.x) {
          break;
        }
        if (k == 0)
        {
          if (d2 >= d1) {
            break;
          }
          d1 = d2;
          i();
          j();
          d2 = h();
          i++;
        }
      }
    } while (k != 0);
  }
  
  double h()
  {
    int j = f.o;
    int i = f.n;
    double d1 = 0.0D;
    a.c.w localw1 = this.l.v();
    label138:
    label145:
    label217:
    label219:
    do
    {
      if (!localw1.e()) {
        break;
      }
      e locale = localw1.d();
      double d2 = this.l.o(locale).a();
      double d3 = 0.0D;
      if (i != 0) {
        break label223;
      }
      double d4 = 0.0D;
      a.c.w localw2 = locale.p();
      do
      {
        do
        {
          if (!localw2.e()) {
            break;
          }
          d3 += this.l.o(localw2.d()).a() - d2;
          localw2.f();
          if (j != 0) {
            break label145;
          }
          if (i != 0) {
            break label138;
          }
        } while (i == 0);
      } while (j != 0);
      localw2 = locale.q();
      do
      {
        do
        {
          if (!localw2.e()) {
            break;
          }
          d4 += this.l.o(localw2.d()).a() - d2;
          localw2.f();
          if (j != 0) {
            break label219;
          }
          if (i != 0) {
            break label217;
          }
        } while (i == 0);
        d1 += Math.abs(d3 + d4);
      } while (j != 0);
      localw1.f();
    } while (i == 0);
    label223:
    return d1;
  }
  
  void i()
  {
    int m = f.o;
    int k = f.n;
    int i = 1;
    label38:
    label49:
    label101:
    do
    {
      if (i >= this.z.length) {
        break;
      }
      e[] arrayOfe = this.z[i];
      c(arrayOfe);
      f(arrayOfe);
      do
      {
        int j = 0;
        y localy = this.A.h();
        do
        {
          if (localy.e()) {
            break label101;
          }
          do
          {
            do
            {
              a_ locala_ = (a_)localy.j();
              if (k != 0) {
                break;
              }
              if (a(locala_, arrayOfe) == true) {
                j = 1;
              }
              localy.f();
              if (k == 0) {
                break label49;
              }
            } while (m != 0);
            if (j != 0) {
              break label38;
            }
            a(arrayOfe);
            i++;
          } while (m != 0);
        } while (k != 0);
      } while (m != 0);
    } while (k == 0);
  }
  
  void j()
  {
    int m = f.o;
    int k = f.n;
    int i = this.z.length - 2;
    label41:
    label107:
    label113:
    do
    {
      if (i < 0) {
        break;
      }
      e[] arrayOfe = this.z[i];
      e(arrayOfe);
      f(arrayOfe);
      do
      {
        do
        {
          int j = 0;
          break label107;
          y localy = this.A.h();
          do
          {
            do
            {
              if (!localy.e()) {
                break;
              }
              a_ locala_ = (a_)localy.j();
              if ((m == 0) && (k != 0)) {
                break label113;
              }
              if (a(locala_, arrayOfe) == true) {
                j = 1;
              }
              localy.f();
            } while (k == 0);
            if (m != 0) {
              break label41;
            }
            if (j != 0) {
              break;
            }
            a(arrayOfe);
            i--;
          } while (m != 0);
        } while (k != 0);
      } while (m != 0);
    } while (k == 0);
  }
  
  void a(e[] paramArrayOfe)
  {
    int j = f.o;
    int i = f.n;
    y localy = this.A.h();
    do
    {
      if (!localy.e()) {
        break;
      }
      a_ locala_2 = (a_)localy.j();
      double d1 = locala_2.a();
      double d2 = d1;
      e locale1;
      e locale2;
      a_ locala_1;
      if (d1 < 0.0D)
      {
        locale1 = (e)locala_2.a.a();
        if (j != 0) {
          continue;
        }
        if (this.r[locale1.f()] > 0)
        {
          locale2 = paramArrayOfe[(this.r[locale1.f()] - 1)];
          locala_1 = this.q[locale2.f()];
          d2 = Math.max(d1, -(a(locale2, locale1) - this.f));
          if (j != 0) {
            continue;
          }
          if (i == 0) {}
        }
      }
      else
      {
        locale2 = (e)locala_2.a.d();
        if (j != 0) {
          continue;
        }
        if (this.r[locale2.f()] < paramArrayOfe.length - 1)
        {
          locale1 = paramArrayOfe[(this.r[locale2.f()] + 1)];
          locala_1 = this.q[locale1.f()];
          d2 = Math.min(d1, a(locale2, locale1) - this.f);
        }
      }
      locala_2.a(d2);
      localy.f();
    } while (i == 0);
  }
  
  void c(e[] paramArrayOfe)
  {
    int k = f.o;
    int j = f.n;
    int i = 0;
    label54:
    label55:
    do
    {
      if (i >= paramArrayOfe.length) {
        break;
      }
      e locale = paramArrayOfe[i];
      if (k == 0)
      {
        if (locale.d() != 0) {
          break label54;
        }
        if (k != 0) {
          break label55;
        }
      }
      double d2;
      do
      {
        this.p[locale.f()] = 0.0D;
        if (j == 0) {
          break;
        }
        double d1 = this.l.o(locale).a();
        d2 = 0.0D;
        a.c.w localw = locale.p();
        do
        {
          if (!localw.e()) {
            break;
          }
          d2 += this.l.o(localw.d()).a() - d1;
          localw.f();
          if (k != 0) {
            break label160;
          }
          if (j != 0) {
            break label158;
          }
        } while (j == 0);
      } while (k != 0);
      this.p[locale.f()] = (d2 / locale.d());
      i++;
    } while (j == 0);
    label158:
    label160:
    return;
  }
  
  void e(e[] paramArrayOfe)
  {
    int k = f.o;
    int j = f.n;
    int i = 0;
    label54:
    label55:
    do
    {
      if (i >= paramArrayOfe.length) {
        break;
      }
      e locale = paramArrayOfe[i];
      if (k == 0)
      {
        if (locale.e() != 0) {
          break label54;
        }
        if (k != 0) {
          break label55;
        }
      }
      double d2;
      do
      {
        this.p[locale.f()] = 0.0D;
        if (j == 0) {
          break;
        }
        double d1 = this.l.o(locale).a();
        d2 = 0.0D;
        a.c.w localw = locale.q();
        do
        {
          if (!localw.e()) {
            break;
          }
          d2 += this.l.o(localw.d()).a() - d1;
          localw.f();
          if (k != 0) {
            break label160;
          }
          if (j != 0) {
            break label158;
          }
        } while (j == 0);
      } while (k != 0);
      this.p[locale.f()] = (d2 / locale.e());
      i++;
    } while (j == 0);
    label158:
    label160:
    return;
  }
  
  void f(e[] paramArrayOfe)
  {
    int j = f.n;
    this.A = new z();
    int i = 0;
    do
    {
      if (i >= paramArrayOfe.length) {
        break;
      }
      e locale = paramArrayOfe[i];
      a_ locala_ = new a_(locale);
      this.q[locale.f()] = locala_;
      this.A.b(locala_);
      i++;
    } while (j == 0);
  }
  
  boolean a(a_ parama_, e[] paramArrayOfe)
  {
    int j = f.o;
    int i = f.n;
    e locale2 = (e)parama_.a.d();
    boolean bool = false;
    if (j == 0) {
      if (this.r[locale2.f()] < paramArrayOfe.length - 1)
      {
        e locale1 = paramArrayOfe[(this.r[locale2.f()] + 1)];
        a_ locala_ = this.q[locale1.f()];
        if (j != 0) {
          break label206;
        }
        if (a(locale2, locale1) < this.f)
        {
          if (j != 0) {
            break label206;
          }
          if (parama_.a() >= locala_.a())
          {
            bool = true;
            y localy = locala_.a.h();
            do
            {
              do
              {
                if (!localy.e()) {
                  break;
                }
                e locale3 = (e)localy.j();
                parama_.a.b(locale3);
                this.q[locale3.f()] = parama_;
                localy.f();
                if (j != 0) {
                  break label206;
                }
                if (i != 0) {
                  break label204;
                }
              } while (i == 0);
            } while (j != 0);
            this.A.remove(locala_);
          }
        }
      }
    }
    label204:
    label206:
    return bool;
  }
  
  double a(e parame1, e parame2)
  {
    double d1 = this.l.r(parame1).a() + this.l.u(parame1).b();
    double d2 = this.l.r(parame2).a();
    return d2 - d1;
  }
  
  private void a(String paramString)
  {
    System.out.println(paramString);
  }
  
  void k()
  {
    int k = f.o;
    int j = f.n;
    l();
    double d1 = 1.7976931348623157E+308D;
    double d2 = h();
    if (k == 0) {
      if (d2 >= d1) {
        d1 = d2 + 1.0D;
      }
    }
    int i = 0;
    do
    {
      while (j == 0)
      {
        if (i >= this.y) {
          break;
        }
        m();
        d2 = h();
        i++;
      }
    } while (k != 0);
  }
  
  void l()
  {
    int k = f.o;
    int j = f.n;
    this.u = 50;
    this.v = 10;
    this.w = 0.5D;
    do
    {
      for (int i = this.l.k() - 1; j == 0; i--)
      {
        if (i < 0) {
          break;
        }
        this.s[i] = this.u;
        this.t[i] = 0.0D;
      }
    } while (k != 0);
  }
  
  void m()
  {
    int i1 = f.o;
    int n = f.n;
    int i = 0;
    label204:
    do
    {
      if (i >= this.z.length) {
        break;
      }
      e[] arrayOfe = this.z[i];
      int j = 0;
      do
      {
        do
        {
          if (j >= arrayOfe.length) {
            break label388;
          }
          e locale1 = arrayOfe[j];
          double d1 = p(locale1);
          double d2 = d1;
          int k = this.s[locale1.f()];
          if (n != 0) {
            break;
          }
          if (d1 < 0.0D)
          {
            if (i1 != 0) {
              break label204;
            }
            if (this.r[locale1.f()] > 0)
            {
              e locale2 = arrayOfe[(this.r[locale1.f()] - 1)];
              d2 = Math.max(d1, -(a(locale2, locale1) - this.f));
              if (i1 != 0) {
                break label204;
              }
              if (n == 0) {}
            }
          }
          else
          {
            if (i1 != 0) {
              break label204;
            }
            if (this.r[locale1.f()] < arrayOfe.length - 1)
            {
              e locale3 = arrayOfe[(this.r[locale1.f()] + 1)];
              d2 = Math.min(d1, a(locale1, locale3) - this.f);
            }
          }
          if (i1 == 0) {
            if (d2 != 0.0D)
            {
              if (i1 != 0) {
                break label269;
              }
              if (d2 * this.t[locale1.f()] >= 0.0D) {
                break label258;
              }
            }
          }
          int m = (int)((1.0D - this.w) * k);
          if (i1 == 0) {
            if (n != 0) {
              m = (int)((1.0D + this.w) * k);
            }
          }
          if (i1 == 0) {
            if (m < 0)
            {
              m = 0;
              if (i1 != 0) {
                continue;
              }
              if (n == 0) {
                break label310;
              }
            }
          }
          if (i1 == 0)
          {
            if (m > 100) {
              m = 100;
            }
            this.u += (m - k) / this.l.k();
            this.l.b(locale1, this.l.r(locale1).b(d2, 0.0D));
            this.t[locale1.f()] = d2;
            this.s[locale1.f()] = m;
            j++;
          }
        } while (n == 0);
        i++;
      } while (i1 != 0);
    } while (n == 0);
    label258:
    label269:
    label310:
    return;
  }
  
  double p(e parame)
  {
    int j = f.o;
    int i = f.n;
    double d1 = 0.0D;
    double d2 = this.l.o(parame).a();
    if ((j != 0) || (parame.c() > 0))
    {
      a.c.w localw = parame.o();
      if (localw.e()) {}
      for (;;)
      {
        if (j == 0)
        {
          d1 += this.l.o(localw.d()).a() - d2;
          localw.f();
          if (i == 0)
          {
            if (i == 0) {
              break;
            }
            if (j != 0) {
              continue;
            }
            d1 /= parame.c();
          }
        }
      }
    }
    return d1;
  }
  
  class a_
  {
    z a = new z();
    z b;
    z c;
    int d;
    int e;
    boolean f;
    
    a_(e parame)
    {
      this.a.b(parame);
    }
    
    double a()
    {
      int j = f.o;
      int i = f.n;
      double d1 = 0.0D;
      y localy = this.a.h();
      if (localy.e()) {}
      for (;;)
      {
        if (j == 0)
        {
          d1 += j.this.p[((e)localy.j()).f()];
          localy.f();
          if (i == 0)
          {
            if (i == 0) {
              break;
            }
            if (j != 0) {
              continue;
            }
            d1 /= this.a.size();
          }
        }
      }
      return d1;
    }
    
    void a(double paramDouble)
    {
      int i = f.n;
      y localy = this.a.h();
      do
      {
        if (!localy.e()) {
          break;
        }
        e locale = (e)localy.j();
        j.this.l.b(locale, j.this.l.r(locale).b(paramDouble, 0.0D));
        localy.f();
      } while (i == 0);
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.d.j

 * JD-Core Version:    0.7.0.1

 */